tongfusoft.taskDetail = function() {
}
tongfusoft.taskDetail.prototype = {

	
	query : function() {
		var params = {};
		params["taskDetailId"] = $("#taskDetailId").val();
		common.post('taskDetail?query', params, function(data) {

			if (data.state == 'success') {

				
				$.map(data.data, function(item, index) {

					if (index == 'taskTag') {

						var tagHtml = '';
						$.each(item.split(","), function(k, v) {
							if (v != '') {
								tagHtml = tagHtml + '	<span class="tag label label-info">' + v + '</span>';

							}
						})
						$("#taskTag").html(tagHtml);

					} else if (index == 'docList') {

						var docHtml = '';
						$.each(item, function(k, v) {
							var url = 'document/download/' + v.docId;
							docHtml = docHtml + '	<span><a docId="' + v.docId
									+ '" class="downloadBtn"  target="_blank" href="' + common.getContextPath(url)
									+ '">' + v.original + ';</a></span>';

						})
						$("#docList").html(docHtml);
					} else {

						$("#" + index).text(item);
					}

				});

			}
			
		});
		
	}

}

$(function() {

	var obj = new tongfusoft.taskDetail();
	obj.query();

})